package com.tiger.db.service;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.tiger.db.entity.PlatformConfig;
import com.tiger.db.mapper.PlatformConfigMapper;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class DPlatformConfigService extends BaseService<PlatformConfigMapper, PlatformConfig> {


    public PlatformConfig getConfig() {
        List<PlatformConfig> config = list();
        return config.isEmpty() ? null : config.get(0);
    }

    public PlatformConfig getConfig(SFunction<PlatformConfig, ?>... columns) {
        List<PlatformConfig> config = list(new LambdaQueryWrapper<PlatformConfig>().select(columns));
        return config.isEmpty() ? null : config.get(0);
    }
}
